package com.tmc.dao.impl.intair;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.springframework.stereotype.Repository;

import com.tmc.bean.common.ContextInfo;
import com.tmc.dao.impl.BaseDaoImpl;
import com.tmc.entity.intair.IntairPassenger;

@Repository
public class IntairPassengerDaoImpl extends BaseDaoImpl<IntairPassenger> {

	public List<IntairPassenger> findByOrderId(ContextInfo context, Long orderId) {
		if (orderId == null) {
			return null;
		}
		Map<String, Object> params = new HashMap<String, Object>();
		StringBuilder sql = new StringBuilder();
		sql.append(" from IntairPassenger c where c.enabledFlag = 'Y' ");
		sql.append(" and c.orderId = :orderId ");
		params.put("orderId", orderId);
		return this.findList(sql.toString(),params);
	}
	
	public List<IntairPassenger> findAll(ContextInfo context) {
		Map<String, Object> params = new HashMap<String, Object>();
		StringBuilder sql = new StringBuilder();
		sql.append(" from IntairPassenger c where c.enabledFlag = 'Y' ");
		return this.findList(sql.toString(), params);
	}
}
